package xyz.lne.researchgroupmanage.service;

import org.springframework.web.multipart.MultipartFile;
import xyz.lne.researchgroupmanage.controller.request.FileRequest;
import xyz.lne.researchgroupmanage.controller.request.ImageRequest;
import xyz.lne.researchgroupmanage.controller.response.FileResponse;
import xyz.lne.researchgroupmanage.controller.response.ImageResponse;
import xyz.lne.researchgroupmanage.entity.File;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.lne.researchgroupmanage.service.dataTransferObject.FileDTO;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author team7
 * @since 2021-01-19
 */
public interface FileService extends IService<File> {
//    课题文件云盘
    FileDTO uploadFileShare(MultipartFile uploadFile, Integer parentId, Integer researchId, Integer userId);

//    任务和文档模块上传文件
    FileDTO uploadFileTaskOrDocument(MultipartFile uploadFile, Integer kind, Integer researchId, Integer userId);

//   上传图片 返回图片地址
    FileDTO uploadImage(MultipartFile image, Integer kind);

    FileDTO makeDirectory(String directoryName, Integer researchId, Integer parentId, Integer userId);

    FileDTO renameDirectory(Integer fileId, String directoryName, Integer userId);

//    逻辑删除
    Boolean deleteFile(Integer fileId);

//    文档和任务服务调用
    FileDTO findFileByFileId(Integer fileId);

//    课题组原始目录文件
    List<FileDTO> findResearchFileList(Integer researchId);

//    文件夹下的子文件（可用于查找根目录）
    List<FileDTO> findChildrenFileList(Integer parentId);
}
